- breadcrumb_title s_('Observability|O11y Service Settings')
- page_title s_('Observability|O11y Service Settings')

%h1.gl-sr-only= @breadcrumb_title

- add_page_specific_style 'page_bundles/settings'

= render ::Layouts::SettingsBlockComponent.new(s_('Observability|Observability Service Configuration'),
  id: 'o11y-service-settings',
  expanded: true) do |c|
  - c.with_description do
    = s_('Observability|Configure your observability service connection settings.')
  - c.with_body do
    = gitlab_ui_form_for @settings, url: group_observability_o11y_service_settings_path(@group), method: :put, authenticity_token: true do |f|
      = form_errors(@settings)

      = render 'form_fields', f: f

      .form-group.gl-form-group
        = f.submit s_('Save changes'), pajamas_button: true

- if @settings.persisted?
  = render ::Layouts::SettingsBlockComponent.new(s_('Observability|Danger Zone'),
    id: 'o11y-service-settings-danger-zone',
    expanded: false) do |c|
    - c.with_description do
      = s_('Observability|Permanently delete the observability service configuration.')
    - c.with_body do
      = link_button_to s_('Observability|Delete settings'), group_observability_o11y_service_settings_path(@group),
        method: :delete,
        variant: :danger,
        category: :secondary,
        data: { confirm: s_('Observability|Are you sure you want to delete the observability service settings? This action cannot be undone.'),
                'confirm-btn-variant': 'danger' }
